<?php 

if (isset ($_GET['shiftAction'])){
	switch ($_GET['shiftAction'])
	{
		case 'Delete Shift':
			$resultsRemoveShift = removeShift($userName, $userPassHash, $_GET['roleID'], $_GET['dateID'], $_GET['empID']);
			break;
	}
}


$viewDate;
if (isset ($_GET['viewDate'])){
	$viewDate = $_GET['viewDate'];
}
else {
	$viewDate = date("Y-m-d");
}
$viewDate = strtotime($viewDate);

?>

<form action="template.php">
	<input type="date" name="viewDate" value="<?php echo(date("Y-m-d", $viewDate)); ?>" />
	<input type="submit" name="dateRange" value="View Surrounding Week" />
	<input type="submit" name="dateRange" value="View Day" />
</form>

<?php

$dateRange;
if (isset ($_GET['dateRange']))
{
	$dateRange = $_GET['dateRange'];
	$_SESSION['dateRange'] = $dateRange;
}
elseif (isset ($_SESSION['dateRange']))
{
	$dateRange = $_SESSION['dateRange'];
}
else
{
	$dateRange = "View Surrounding Week";
}

switch ($dateRange){
	case "View Day":
		include_once "shiftManagerDaily.php";
		break;
	case "View Surrounding Week":
	default:
		include_once "shiftManagerWeekly.php";
		break;
}

?>